class Admin::CmsController < Admin::BaseController
  def index
  end

  def create
  	if params["hot_keyword"]
  		valid_ret = "ok"
		else
    	valid_ret = RecommendItem.valid_related_ids(params["period"], params["recommend_type"])
  	end
  	
		if valid_ret == "ok"
			RecommendItem.saved(params["period"], params["flag"], params["recommend_type"], params["hot_keyword"])
		  flash[:notice] = '更新成功'
		else
			flash[:error] = "#{_valid_ret} 不存在，请检查"		
		end
		if(params["recommend_type"].to_s == "0") then redirect_to '/admin/cms/shops' 
		else	redirect_to '/admin/cms'
		end
  end
  
  def shops
  	
  end

end
